home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / boot / czesc_2 / onekeyii / src / icon.c < prev    next >
C/C++ Source or Header  |  1992-11-12  |  1KB  |  66 lines

  1. /*
  2.  *  Routines dealing with processing of Onekey's icon
  3.  *  (be they for tooltypes or AppIcon purposes).
  4.  *  
  5.  *  MWS, Tuesday 13-Oct-92
  6.  */
  7. #include <exec/types.h>
  8. #include <dos/dos.h>
  9. #include <workbench/startup.h>
  10. #include <workbench/workbench.h>
  11. #include <proto/exec.h>
  12. #include <proto/dos.h>
  13. #include <proto/wb.h>
  14. #include <proto/icon.h>
  15.  
  16. static struct DiskObject *onekeyobj;
  17.  
  18. BOOL
  19. GetOurIcon(struct WBStartup *WBenchMsg)
  20. {
  21.     if (WBenchMsg)
  22.         onekeyobj = GetDiskObject(WBenchMsg->sm_ArgList->wa_Name);
  23.     return onekeyobj ? TRUE : FALSE;
  24. }
  25.  
  26. void
  27. FreeOurIcon()
  28. {
  29.     if (onekeyobj) FreeDiskObject(onekeyobj);
  30. }
  31.  
  32. /* like ArgString() */
  33. char *
  34. TTString(char *name, char *def)
  35. {
  36.     char *what;
  37.     if (onekeyobj)
  38.         if (what = FindToolType(onekeyobj->do_ToolTypes, name))
  39.             return what;
  40.     return def;
  41. }
  42.  
  43. /* like ArgInt() */
  44. LONG
  45. TTInt(char *name, LONG def)
  46. {
  47.     char *what;
  48.     if (onekeyobj)
  49.         if (what = FindToolType(onekeyobj->do_ToolTypes, name))
  50.             StrToLong(what, &def);
  51.     return def;
  52. }
  53.  
  54. /* simple extension to ArgXXX routines */
  55. BOOL
  56. TTBool(char *name, BOOL def)
  57. {
  58.     char    *s;
  59.  
  60.     s = TTString(name, def ? "YES" : "NO");
  61.  
  62.     return    ((strcmp(s, "YES") == 0) ||
  63.         (strcmp(s, "TRUE") == 0) ||
  64.         (strcmp(s, "ON") == 0)) ? TRUE : FALSE;
  65. }
  66.